using UnityEngine;

/// <summary>
/// 死亡状态
/// </summary>
public class DeathState : IState
{
    public DeathState(FSM manager)
    {
        this.manager = manager;
        this.parameter = manager.parameter;
    }

    public override void OnEnter()
    {
        AudioManager.Instance.PlaySFX("游戏结束");
        parameter.isDead = true;
        parameter.rb.velocity = Vector2.zero;
        manager.SwitchActionMap(parameter.inputSystem.UI);//切换为UI输入
        // parameter.animator.Play("Dead");
        parameter.animator.SetBool("isDead", parameter.isDead);
        GameManager.Instance.GameOver();
    }

    public override void OnUpdate() { }

    public override void OnFixedUpdate() { }

    public override void OnExit() { }
}
